package com.example.rdiobuttonmenu.fragment;


import android.os.Bundle;

import androidx.fragment.app.Fragment;

import android.view.LayoutInflater;
import android.view.View;
import android.view.ViewGroup;
import android.widget.TextView;

import com.example.rdiobuttonmenu.R;

/**
 * A simple {@link Fragment} subclass.
 */
public class MessageFragment extends Fragment {
    public static MessageFragment getInstance(String name){
        MessageFragment messageFragment=new MessageFragment();
        Bundle bundle=new Bundle();
        bundle.putString("name",name);
        messageFragment.setArguments(bundle);
        return messageFragment;
    }

    public MessageFragment() {
        // Required empty public constructor
    }


    @Override
    public View onCreateView(LayoutInflater inflater, ViewGroup container,
                             Bundle savedInstanceState) {
        // Inflate the layout for this fragment
        View view = inflater.inflate(R.layout.fragment_message, container, false);
        TextView textView=view.findViewById(R.id.tv_message);
        textView.setText(getArguments().getString("name"));
        return view;
    }

}
